import 'package:flutter/material.dart';
import 'package:myapp/navigator/tab_navigater.dart';
import 'package:myapp/pages/NewRout.dart';
import 'package:myapp/pages/tip_route.dart';
// import 'src/httptest.dart';
// import 'src/isolateTest.dart';
// import 'src/todoList/TodoList.dart';
// import 'package:myapp/pages/home/home.dart';

void main() {
  runApp(new MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        accentColor: Colors.orange,
        primaryColor: const Color(0xFFDE4435),
      ),
      // home: TabNavigator(),
      initialRoute: "/",
      routes: {
        "/": (context) => TabNavigator(),
        "new_page": (context) => NewRoute(),
        "tip2": (context) {
          return TipRoute(text: ModalRoute.of(context).settings.arguments);
        }
      },
      // 注意，onGenerateRoute只会对命名路由生效。
      onGenerateRoute: (RouteSettings settings) {
        return MaterialPageRoute(builder: (context) {
          String routeName = settings.name;
          // 如果访问的路由页需要登录，但当前未登录，则直接返回登录页路由，
          // 引导用户登录；其它情况则正常打开路由
        });
      },
    );
  }
}
